package com.casic.worklog.service;

import com.casic.worklog.dao.EmpSignMapper;
import com.casic.worklog.model.EmpSign;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @author Administrator
 * @date 2019/9/18 22:34
 */
@Service
public class SignService {

    @Resource
    private EmpSignMapper empSignMapper;

    /**获取今日签到信息*/
    public EmpSign selectStatTime(Short id){
        return empSignMapper.selectStatTime(id);
    }

    /**获取今日签退时间*/
    public Date selectEndTime(Short id){
        return empSignMapper.selectEndTime(id);
    }
    /**插入新打卡信息*/
    public int insert(EmpSign empSign){
        return empSignMapper.insert(empSign);
    }

   /**已签退情况，根据上次签退时间更新签退时间*/
   public int updateBySignId(EmpSign empSign){
       return  empSignMapper.updateBySignId(empSign);
   }

    /**本月签到次数*/
    public int signInTimes(Short id){
        return empSignMapper.signInTimes(id);
    }

    /**本月签退次数*/
    public int signOutTimes(Short id){
        return empSignMapper.signOutTimes(id);
    }

    /**本月迟到次数*/
    public int lateTimes(Short id){
        return empSignMapper.lateTimes(id);
    }

    /**本月早退次数*/
    public int leaveEarlyTimes(Short id){
        return empSignMapper.leaveEarlyTimes(id);
    }
}
